package com.micro.mic_common.other;

import com.micro.mic_common.enums.ResultEnums;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Description 自定义业务异常
 * @Author yijian
 * @Date 2021/12/28 17:39
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class BusinessException extends RuntimeException {
    /**
     * 错误码
     */
    private String code;
    /**
     * 错误信息
     */
    private String msg;

    public BusinessException(ResultEnums resultEnums){
        this.code = resultEnums.getCode();
        this.msg = resultEnums.getMsg();
    }
}
